program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement = ^element;
  element = record
    value : Integer;
    next : pelement;
  end;

var
  fin : textfile;
  n, b, i, a: integer;
  head : pelement;

procedure Add (var head : pelement; num : integer);
var tmp : pelement;
begin
  tmp := head;
  New (head);
  head^.value := num;
  head^.next := tmp;
end;

function Delete (var head : pelement):integer;
var tmp : pelement;
begin
  if (head <> nil) then
  begin
    tmp := head^.next;
    Delete := head^.value;
    Dispose (head);
    head := tmp;
  end;
end;

function Delete2 (var head:pelement):integer;
var tmp : pelement;
begin
  tmp:=head;
  if (head<>nil) then
  begin
      if (tmp^.value mod 2 <> 0) then
        if (head^.next<>nil) then
          Delete2(head^.next);
      if (tmp^.value mod 2 = 0) then
      begin
        tmp := head^.next;
        Delete2 := head^.value;
        Dispose (head);
        head := tmp;
      end;
  end;
end;

procedure PrintList (head : pelement);
var current : pelement;
begin
  current := head;
  while (current <> nil) do
  begin
    Writeln (current^.value);
    current := current^.next;
  end;
end;

begin
  assignfile(fin, 'input.txt') ;
  reset(fin);
  b:=0;

  readln(fin, n);
  for i:= 0 to n-1 do
  begin
    read(fin, a);
    if (a mod 2 <> 0)  then
      b:=b+1;
    Add(head, a);
  end;

  for i := 0 to n-1 do
    Delete2(head);

  PrintList(head);
  writeln(' ');

  for i := b-1 downto 0 do
  begin
    if (head<>nil) then
    begin
      head^.value:=head^.value+(i*2 + 1);
      writeln(head^.value);
      head:=head^.next;
    end;
  end;

  for i := 0 to n-1 do
    Delete(head);

  closefile(fin);
  readln;
end.
